﻿@page "/GridLargeDataBase"
@layout DataProviderAccessArea<IRentInfoDataProvider>

@inject RentInfoDataService RentInfoDataService

<div class="demo-description mw-1100">
    <h2>Data Grid - Large Data Source</h2>

    <p>
        This demo shows the performance of the <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxDataGrid-1">data grid</a> when it is bound to a dataset that contains a million rows with a total size of over 1GB.
        Experiment with navigating between the pages and sorting the data to experience the responsiveness of the grid in this situation.
    </p>
    <p>
        In this example, Entity Framework Core (version 3.0) supplies Data Grid with an <a class="helplink" target="_blank" href="https://docs.microsoft.com/ru-ru/dotnet/api/system.linq.iqueryable-1">IQueryable&lt;T&gt;</a> source.
    </p>
</div>

<DxDataGrid DataAsync="@RentInfoDataService.GetQueryableAreaRentInfo"
            SelectionMode="DataGridSelectionMode.None"
            PageSize="10"
            KeyFieldName="Oid"
            CssClass="mw-1100">
    <DxDataGridColumn Field="@nameof(AreaRentInfo.State)" AllowSort="false"></DxDataGridColumn>
    <DxDataGridColumn Field="@nameof(AreaRentInfo.Area)" AllowSort="false"></DxDataGridColumn>
    <DxDataGridColumn Field="@nameof(AreaRentInfo.City)" Caption="County" AllowSort="false"></DxDataGridColumn>
    <DxDataGridColumn Field="@nameof(AreaRentInfo.Name)" Caption="Location" AllowSort="false"></DxDataGridColumn>
    <DxDataGridSpinEditColumn Field="@nameof(AreaRentInfo.Year)"></DxDataGridSpinEditColumn>
    <DxDataGridSpinEditColumn Field="@nameof(AreaRentInfo.Bedrooms)"></DxDataGridSpinEditColumn>
    <DxDataGridSpinEditColumn Field="@nameof(AreaRentInfo.Rent)">
        <DisplayTemplate>
            @(((context as AreaRentInfo).Rent).ToString("C2"))
        </DisplayTemplate>
    </DxDataGridSpinEditColumn>
    <DxDataGridSpinEditColumn Field="@nameof(AreaRentInfo.Population)" AllowSort="false">
        <DisplayTemplate>
            @(((context as AreaRentInfo).Population).ToString("#,0"))
        </DisplayTemplate>
    </DxDataGridSpinEditColumn>
</DxDataGrid>

<CodeSnippet_GridLargeDataBase></CodeSnippet_GridLargeDataBase>
